//
//  H_D_FirCell.m
//  Tang
//
//  Created by lanou on 15/12/7.
//  Copyright © 2015年 352324497@qq.com. All rights reserved.
//

#import "H_D_FirCell.h"
#define KFontSize (23 * KWidth / 414 )
#define Kspace  (10* KWidth / 414)
#define KcellWid (KWidth - Kspace * 2)


@implementation H_D_FirCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = NO;
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.font = [UIFont systemFontOfSize:KFontSize];
        self.titleLabel.alpha = 0.8;
        self.titleLabel.numberOfLines = 0;
        
        self.descrLabel = [[UILabel alloc] init];
        self.descrLabel.font = [UIFont systemFontOfSize:KFontSize* 0.8];
        self.descrLabel.alpha = 0.8;
        self.descrLabel.numberOfLines = 0;

        
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_descrLabel];
        
        
        
        
    }
    return self;
}

- (void)setTitleLabelDescrLabelWithstring:(NSString *)title descr:(NSString *)descr
{
    CGFloat titleHei = [CallTool heightWithLabel:_titleLabel ForNSStringWithString:title width:KcellWid fontSize:KFontSize space:6];
    self.titleLabel.frame = CGRectMake(Kspace, Kspace, KcellWid, titleHei);
    
    
    CGFloat descrHei = [CallTool heightWithLabel:_descrLabel ForNSStringWithString:descr width:KcellWid fontSize:KFontSize * 0.8 space:6];
    self.descrLabel.frame = CGRectMake(Kspace, self.titleLabel.height + Kspace , KcellWid, self.titleLabel.height + descrHei);
}

+ (CGFloat)heightForRowWithTitle:(NSString *)title desc:(NSString *)desc
{
    CGFloat height = [CallTool heightForNSStringWithString:title width:KcellWid fontSize:KFontSize space:6 ] + [CallTool heightForNSStringWithString:desc width:KcellWid fontSize:KFontSize * 0.8 space:6];
    return height + Kspace * 2;
}






@end
